package javaer.starter.placeholder.character;


import javaer.starter.constants.SymbolEnum;
import javaer.starter.placeholder.PlaceholderTokenParser;

/**
 * 查找#{}占位符的内容，并替换为freemarker转义后的占位符
 *
 * @author yangzhen
 * @date 2021/12/7 11:28
 * @since 1.0.0
 */
public class MybatisVariableEscapeTokenHandler extends PlaceholderTokenParser {

    public String handleToken(String content) {
        return SymbolEnum.VARIABLE_OPEN_TOKEN_ESCAPE_1.getSymbol() + content + SymbolEnum.VARIABLE_CLOSE_TOKEN_ESCAPE.getSymbol();
    }

    @Override
    public String getOpenToken() {
        return SymbolEnum.PLACEHOLDER_START_1.getSymbol();
    }

    @Override
    public String getCloseToken() {
        return SymbolEnum.PLACEHOLDER_END.getSymbol();
    }
}
